package com.ugoodtech.mdcc.core.repository;

import com.ugoodtech.mdcc.core.domain.StationColorReportTemp;
import com.ugoodtech.mdcc.core.domain.StationRegularServiceReportUnFinshed;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface StationColorReportTempRepository extends PagingAndSortingRepository<StationColorReportTemp, Long>
        , QueryDslPredicateExecutor<StationColorReportTemp> {

    @Query("from StationColorReportTemp where report_id=:report_id")
    List<StationColorReportTemp> selectAnswer(@Param("report_id") Long report_id);

    @Query("from StationColorReportTemp where report_id=:report_id and question_id=:questionId and deleted=false and enabled=true")
    StationColorReportTemp selectAnswerByQuestion(@Param("report_id") Long report_id, @Param("questionId") Long questionId);
}
